# $Id: bashrc 804 2010-11-23 09:46:24Z ant_code $
#

PATH="/sbin:/usr/sbin:/usr/bin:/bin:/etc/scripts:/lib/dsktool/bin:."
TERM=linux
PS1="["`tty`"] [\h]:# "
PS2="> "
HOME=/root
export PATH DISPLAY TERM PS1 PS2 MANPATH HOME

umask 032

# common.disks.fn:verify
export DISKS_DONE=

. /lib/dsktool/conf/env
. /lib/dsktool/lib/common.fn
. /lib/dsktool/lib/common.disks.fn
. /lib/dsktool/lib/vault.fn
. /lib/dsktool/lib/disk.fn
. /lib/dsktool/lib/lvm.fn
. /lib/dsktool/lib/laststep.fn
. /lib/dsktool/lib/mountpoint.fn
. /lib/dsktool/lib/network.fn
. /lib/dsktool/lib/md.fn
. /lib/dsktool/lib/nbd.fn
. /lib/dsktool/lib/enclayer.fn
. /lib/dsktool/lib/boot.fn
. /lib/dsktool/lib/scan.fn

# gui
. /lib/dsktool/lib/gui-text-common.fn

. /lib/dsktool/lib/gui/gui.fn
. /lib/dsktool/lib/gui/ghelp.fn
. /lib/dsktool/lib/gui/gcommon.fn
. /lib/dsktool/lib/gui/gcommon.disk.fn
. /lib/dsktool/lib/gui/gdisk.fn
. /lib/dsktool/lib/gui/gmd.fn
. /lib/dsktool/lib/gui/gnbd.fn
. /lib/dsktool/lib/gui/glvm.fn
. /lib/dsktool/lib/gui/glaststep.fn
. /lib/dsktool/lib/gui/ghostname.fn
. /lib/dsktool/lib/gui/gscan.fn
. /lib/dsktool/lib/gui/genclayer.fn
. /lib/dsktool/lib/gui/gnetwork.fn
. /lib/dsktool/lib/gui/gmountpoint.fn
. /lib/dsktool/lib/gui/gboot.fn
. /lib/dsktool/lib/gui/gaasp.fn

# trap
_chk_err ()
{
	if [ "$#" -eq 3 ]; then
		_msg "\nERR:${1}:FUNC:${2}:LINENO:${3}"
	else
		_msg "\nERR:${1}:LINENO:${2}"
	fi
	if [ "$running_mode" = "dsktool" ]; then
		if [ "$(<$disk_commit_switch_running)" = "1" ]; then 
			echo 0 > $disk_commit_switch_running
		fi
		_msg "\nPress [enter] to continue."
		read nothing
	fi
	exec -c /bin/bash
}

# dont blank terminal
echo -e "\e[9;0]"
setterm -blank 0
setterm -store

trap - ERR INT HUP TERM
trap '_chk_err $? $FUNCNAME $LINENO' ERR INT HUP TERM

shopt -s nocasematch
shopt -s checkwinsize
set -eE
set -o pipefail

# aasp
if [ ! -f $vp_pass -a "$(< $gui_switch)" = "0" ]; then
	_warn_msg "Must set the vault password before applying changes related to LUKS, call 'aasp' ..."
fi

# alias
alias gui="echo 1 > $gui_switch ; echo 1 > $gui_permanent_switch ; _gui"
alias text="echo 0 > $gui_permanent_switch"

# gui callbacks
# XXX compare to autoinstall.fn
echo 0 > $gui_switch
gui ; exit

# vim: ts=2 syn=sh
# bashrc: end
